"""
    Pinterest REST API

    Pinterest's REST API  # noqa: E501

    The version of the OpenAPI document: 5.6.0
    Contact: pinterest-api@pinterest.com
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from pinterest.generated.client.api_client import ApiClient, Endpoint as _Endpoint
from pinterest.generated.client.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from pinterest.generated.client.model.ad_account import AdAccount
from pinterest.generated.client.model.ad_account_analytics_response import AdAccountAnalyticsResponse
from pinterest.generated.client.model.ad_account_create_request import AdAccountCreateRequest
from pinterest.generated.client.model.ads_analytics_create_async_request import AdsAnalyticsCreateAsyncRequest
from pinterest.generated.client.model.ads_analytics_create_async_response import AdsAnalyticsCreateAsyncResponse
from pinterest.generated.client.model.ads_analytics_get_async_response import AdsAnalyticsGetAsyncResponse
from pinterest.generated.client.model.ads_analytics_targeting_type import AdsAnalyticsTargetingType
from pinterest.generated.client.model.conversion_report_attribution_type import ConversionReportAttributionType
from pinterest.generated.client.model.error import Error
from pinterest.generated.client.model.granularity import Granularity
from pinterest.generated.client.model.metrics_response import MetricsResponse
from pinterest.generated.client.model.paginated import Paginated


class AdAccountsApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.ad_account_analytics_endpoint = _Endpoint(
            settings={
                'response_type': (AdAccountAnalyticsResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/analytics',
                'operation_id': 'ad_account_analytics',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'columns',
                    'granularity',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'required': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'columns',
                    'granularity',
                ],
                'nullable': [
                ],
                'enum': [
                    'columns',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'validation': [
                    'ad_account_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                    ('columns',): {

                        "ADVERTISER_ID": "ADVERTISER_ID",
                        "PIN_PROMOTION_ID": "PIN_PROMOTION_ID",
                        "AD_ACCOUNT_ID": "AD_ACCOUNT_ID",
                        "AD_GROUP_ENTITY_STATUS": "AD_GROUP_ENTITY_STATUS",
                        "AD_GROUP_ID": "AD_GROUP_ID",
                        "AD_ID": "AD_ID",
                        "CAMPAIGN_DAILY_SPEND_CAP": "CAMPAIGN_DAILY_SPEND_CAP",
                        "CAMPAIGN_ENTITY_STATUS": "CAMPAIGN_ENTITY_STATUS",
                        "CAMPAIGN_ID": "CAMPAIGN_ID",
                        "CAMPAIGN_LIFETIME_SPEND_CAP": "CAMPAIGN_LIFETIME_SPEND_CAP",
                        "CAMPAIGN_NAME": "CAMPAIGN_NAME",
                        "CHECKOUT_ROAS": "CHECKOUT_ROAS",
                        "CLICKTHROUGH_1": "CLICKTHROUGH_1",
                        "CLICKTHROUGH_1_GROSS": "CLICKTHROUGH_1_GROSS",
                        "CLICKTHROUGH_2": "CLICKTHROUGH_2",
                        "CPC_IN_MICRO_DOLLAR": "CPC_IN_MICRO_DOLLAR",
                        "CPM_IN_DOLLAR": "CPM_IN_DOLLAR",
                        "CPM_IN_MICRO_DOLLAR": "CPM_IN_MICRO_DOLLAR",
                        "CTR": "CTR",
                        "CTR_2": "CTR_2",
                        "ECPCV_IN_DOLLAR": "ECPCV_IN_DOLLAR",
                        "ECPCV_P95_IN_DOLLAR": "ECPCV_P95_IN_DOLLAR",
                        "ECPC_IN_DOLLAR": "ECPC_IN_DOLLAR",
                        "ECPC_IN_MICRO_DOLLAR": "ECPC_IN_MICRO_DOLLAR",
                        "ECPE_IN_DOLLAR": "ECPE_IN_DOLLAR",
                        "ECPM_IN_MICRO_DOLLAR": "ECPM_IN_MICRO_DOLLAR",
                        "ECPV_IN_DOLLAR": "ECPV_IN_DOLLAR",
                        "ECTR": "ECTR",
                        "EENGAGEMENT_RATE": "EENGAGEMENT_RATE",
                        "ENGAGEMENT_1": "ENGAGEMENT_1",
                        "ENGAGEMENT_2": "ENGAGEMENT_2",
                        "ENGAGEMENT_RATE": "ENGAGEMENT_RATE",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_1": "IDEA_PIN_PRODUCT_TAG_VISIT_1",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_2": "IDEA_PIN_PRODUCT_TAG_VISIT_2",
                        "IMPRESSION_1": "IMPRESSION_1",
                        "IMPRESSION_1_GROSS": "IMPRESSION_1_GROSS",
                        "IMPRESSION_2": "IMPRESSION_2",
                        "INAPP_CHECKOUT_COST_PER_ACTION": "INAPP_CHECKOUT_COST_PER_ACTION",
                        "OUTBOUND_CLICK_1": "OUTBOUND_CLICK_1",
                        "OUTBOUND_CLICK_2": "OUTBOUND_CLICK_2",
                        "PAGE_VISIT_COST_PER_ACTION": "PAGE_VISIT_COST_PER_ACTION",
                        "PAGE_VISIT_ROAS": "PAGE_VISIT_ROAS",
                        "PAID_IMPRESSION": "PAID_IMPRESSION",
                        "PIN_ID": "PIN_ID",
                        "REPIN_1": "REPIN_1",
                        "REPIN_2": "REPIN_2",
                        "REPIN_RATE": "REPIN_RATE",
                        "SPEND_IN_DOLLAR": "SPEND_IN_DOLLAR",
                        "SPEND_IN_MICRO_DOLLAR": "SPEND_IN_MICRO_DOLLAR",
                        "TOTAL_CHECKOUT": "TOTAL_CHECKOUT",
                        "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICKTHROUGH": "TOTAL_CLICKTHROUGH",
                        "TOTAL_CLICK_ADD_TO_CART": "TOTAL_CLICK_ADD_TO_CART",
                        "TOTAL_CLICK_CHECKOUT": "TOTAL_CLICK_CHECKOUT",
                        "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICK_LEAD": "TOTAL_CLICK_LEAD",
                        "TOTAL_CLICK_SIGNUP": "TOTAL_CLICK_SIGNUP",
                        "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CONVERSIONS": "TOTAL_CONVERSIONS",
                        "TOTAL_CUSTOM": "TOTAL_CUSTOM",
                        "TOTAL_ENGAGEMENT": "TOTAL_ENGAGEMENT",
                        "TOTAL_ENGAGEMENT_CHECKOUT": "TOTAL_ENGAGEMENT_CHECKOUT",
                        "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_ENGAGEMENT_LEAD": "TOTAL_ENGAGEMENT_LEAD",
                        "TOTAL_ENGAGEMENT_SIGNUP": "TOTAL_ENGAGEMENT_SIGNUP",
                        "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT": "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT",
                        "TOTAL_IMPRESSION_FREQUENCY": "TOTAL_IMPRESSION_FREQUENCY",
                        "TOTAL_IMPRESSION_USER": "TOTAL_IMPRESSION_USER",
                        "TOTAL_LEAD": "TOTAL_LEAD",
                        "TOTAL_OFFLINE_CHECKOUT": "TOTAL_OFFLINE_CHECKOUT",
                        "TOTAL_PAGE_VISIT": "TOTAL_PAGE_VISIT",
                        "TOTAL_REPIN_RATE": "TOTAL_REPIN_RATE",
                        "TOTAL_SIGNUP": "TOTAL_SIGNUP",
                        "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIDEO_3SEC_VIEWS": "TOTAL_VIDEO_3SEC_VIEWS",
                        "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND": "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND",
                        "TOTAL_VIDEO_MRC_VIEWS": "TOTAL_VIDEO_MRC_VIEWS",
                        "TOTAL_VIDEO_P0_COMBINED": "TOTAL_VIDEO_P0_COMBINED",
                        "TOTAL_VIDEO_P100_COMPLETE": "TOTAL_VIDEO_P100_COMPLETE",
                        "TOTAL_VIDEO_P25_COMBINED": "TOTAL_VIDEO_P25_COMBINED",
                        "TOTAL_VIDEO_P50_COMBINED": "TOTAL_VIDEO_P50_COMBINED",
                        "TOTAL_VIDEO_P75_COMBINED": "TOTAL_VIDEO_P75_COMBINED",
                        "TOTAL_VIDEO_P95_COMBINED": "TOTAL_VIDEO_P95_COMBINED",
                        "TOTAL_VIEW_ADD_TO_CART": "TOTAL_VIEW_ADD_TO_CART",
                        "TOTAL_VIEW_CHECKOUT": "TOTAL_VIEW_CHECKOUT",
                        "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIEW_LEAD": "TOTAL_VIEW_LEAD",
                        "TOTAL_VIEW_SIGNUP": "TOTAL_VIEW_SIGNUP",
                        "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CHECKOUT": "TOTAL_WEB_CHECKOUT",
                        "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CLICK_CHECKOUT": "TOTAL_WEB_CLICK_CHECKOUT",
                        "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT": "TOTAL_WEB_ENGAGEMENT_CHECKOUT",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_SESSIONS": "TOTAL_WEB_SESSIONS",
                        "TOTAL_WEB_VIEW_CHECKOUT": "TOTAL_WEB_VIEW_CHECKOUT",
                        "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "VIDEO_3SEC_VIEWS_2": "VIDEO_3SEC_VIEWS_2",
                        "VIDEO_LENGTH": "VIDEO_LENGTH",
                        "VIDEO_MRC_VIEWS_2": "VIDEO_MRC_VIEWS_2",
                        "VIDEO_P0_COMBINED_2": "VIDEO_P0_COMBINED_2",
                        "VIDEO_P100_COMPLETE_2": "VIDEO_P100_COMPLETE_2",
                        "VIDEO_P25_COMBINED_2": "VIDEO_P25_COMBINED_2",
                        "VIDEO_P50_COMBINED_2": "VIDEO_P50_COMBINED_2",
                        "VIDEO_P75_COMBINED_2": "VIDEO_P75_COMBINED_2",
                        "VIDEO_P95_COMBINED_2": "VIDEO_P95_COMBINED_2",
                        "WEB_CHECKOUT_COST_PER_ACTION": "WEB_CHECKOUT_COST_PER_ACTION",
                        "WEB_CHECKOUT_ROAS": "WEB_CHECKOUT_ROAS",
                        "WEB_SESSIONS_1": "WEB_SESSIONS_1",
                        "WEB_SESSIONS_2": "WEB_SESSIONS_2"
                    },
                    ('click_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('engagement_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('view_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('conversion_report_time',): {

                        "AD_ACTION": "TIME_OF_AD_ACTION",
                        "CONVERSION": "TIME_OF_CONVERSION"
                    },
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'start_date':
                        (date,),
                    'end_date':
                        (date,),
                    'columns':
                        ([str],),
                    'granularity':
                        (Granularity,),
                    'click_window_days':
                        (int,),
                    'engagement_window_days':
                        (int,),
                    'view_window_days':
                        (int,),
                    'conversion_report_time':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'start_date': 'start_date',
                    'end_date': 'end_date',
                    'columns': 'columns',
                    'granularity': 'granularity',
                    'click_window_days': 'click_window_days',
                    'engagement_window_days': 'engagement_window_days',
                    'view_window_days': 'view_window_days',
                    'conversion_report_time': 'conversion_report_time',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'start_date': 'query',
                    'end_date': 'query',
                    'columns': 'query',
                    'granularity': 'query',
                    'click_window_days': 'query',
                    'engagement_window_days': 'query',
                    'view_window_days': 'query',
                    'conversion_report_time': 'query',
                },
                'collection_format_map': {
                    'columns': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ad_account_targeting_analytics_get_endpoint = _Endpoint(
            settings={
                'response_type': (MetricsResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/targeting_analytics',
                'operation_id': 'ad_account_targeting_analytics_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'targeting_types',
                    'columns',
                    'granularity',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                    'attribution_types',
                ],
                'required': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'targeting_types',
                    'columns',
                    'granularity',
                ],
                'nullable': [
                ],
                'enum': [
                    'columns',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'validation': [
                    'ad_account_id',
                    'targeting_types',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('targeting_types',): {

                        'max_items': 15,
                        'min_items': 1,
                    },
                },
                'allowed_values': {
                    ('columns',): {

                        "ADVERTISER_ID": "ADVERTISER_ID",
                        "PIN_PROMOTION_ID": "PIN_PROMOTION_ID",
                        "AD_ACCOUNT_ID": "AD_ACCOUNT_ID",
                        "AD_GROUP_ENTITY_STATUS": "AD_GROUP_ENTITY_STATUS",
                        "AD_GROUP_ID": "AD_GROUP_ID",
                        "AD_ID": "AD_ID",
                        "CAMPAIGN_DAILY_SPEND_CAP": "CAMPAIGN_DAILY_SPEND_CAP",
                        "CAMPAIGN_ENTITY_STATUS": "CAMPAIGN_ENTITY_STATUS",
                        "CAMPAIGN_ID": "CAMPAIGN_ID",
                        "CAMPAIGN_LIFETIME_SPEND_CAP": "CAMPAIGN_LIFETIME_SPEND_CAP",
                        "CAMPAIGN_NAME": "CAMPAIGN_NAME",
                        "CHECKOUT_ROAS": "CHECKOUT_ROAS",
                        "CLICKTHROUGH_1": "CLICKTHROUGH_1",
                        "CLICKTHROUGH_1_GROSS": "CLICKTHROUGH_1_GROSS",
                        "CLICKTHROUGH_2": "CLICKTHROUGH_2",
                        "CPC_IN_MICRO_DOLLAR": "CPC_IN_MICRO_DOLLAR",
                        "CPM_IN_DOLLAR": "CPM_IN_DOLLAR",
                        "CPM_IN_MICRO_DOLLAR": "CPM_IN_MICRO_DOLLAR",
                        "CTR": "CTR",
                        "CTR_2": "CTR_2",
                        "ECPCV_IN_DOLLAR": "ECPCV_IN_DOLLAR",
                        "ECPCV_P95_IN_DOLLAR": "ECPCV_P95_IN_DOLLAR",
                        "ECPC_IN_DOLLAR": "ECPC_IN_DOLLAR",
                        "ECPC_IN_MICRO_DOLLAR": "ECPC_IN_MICRO_DOLLAR",
                        "ECPE_IN_DOLLAR": "ECPE_IN_DOLLAR",
                        "ECPM_IN_MICRO_DOLLAR": "ECPM_IN_MICRO_DOLLAR",
                        "ECPV_IN_DOLLAR": "ECPV_IN_DOLLAR",
                        "ECTR": "ECTR",
                        "EENGAGEMENT_RATE": "EENGAGEMENT_RATE",
                        "ENGAGEMENT_1": "ENGAGEMENT_1",
                        "ENGAGEMENT_2": "ENGAGEMENT_2",
                        "ENGAGEMENT_RATE": "ENGAGEMENT_RATE",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_1": "IDEA_PIN_PRODUCT_TAG_VISIT_1",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_2": "IDEA_PIN_PRODUCT_TAG_VISIT_2",
                        "IMPRESSION_1": "IMPRESSION_1",
                        "IMPRESSION_1_GROSS": "IMPRESSION_1_GROSS",
                        "IMPRESSION_2": "IMPRESSION_2",
                        "INAPP_CHECKOUT_COST_PER_ACTION": "INAPP_CHECKOUT_COST_PER_ACTION",
                        "OUTBOUND_CLICK_1": "OUTBOUND_CLICK_1",
                        "OUTBOUND_CLICK_2": "OUTBOUND_CLICK_2",
                        "PAGE_VISIT_COST_PER_ACTION": "PAGE_VISIT_COST_PER_ACTION",
                        "PAGE_VISIT_ROAS": "PAGE_VISIT_ROAS",
                        "PAID_IMPRESSION": "PAID_IMPRESSION",
                        "PIN_ID": "PIN_ID",
                        "REPIN_1": "REPIN_1",
                        "REPIN_2": "REPIN_2",
                        "REPIN_RATE": "REPIN_RATE",
                        "SPEND_IN_DOLLAR": "SPEND_IN_DOLLAR",
                        "SPEND_IN_MICRO_DOLLAR": "SPEND_IN_MICRO_DOLLAR",
                        "TOTAL_CHECKOUT": "TOTAL_CHECKOUT",
                        "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICKTHROUGH": "TOTAL_CLICKTHROUGH",
                        "TOTAL_CLICK_ADD_TO_CART": "TOTAL_CLICK_ADD_TO_CART",
                        "TOTAL_CLICK_CHECKOUT": "TOTAL_CLICK_CHECKOUT",
                        "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICK_LEAD": "TOTAL_CLICK_LEAD",
                        "TOTAL_CLICK_SIGNUP": "TOTAL_CLICK_SIGNUP",
                        "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CONVERSIONS": "TOTAL_CONVERSIONS",
                        "TOTAL_CUSTOM": "TOTAL_CUSTOM",
                        "TOTAL_ENGAGEMENT": "TOTAL_ENGAGEMENT",
                        "TOTAL_ENGAGEMENT_CHECKOUT": "TOTAL_ENGAGEMENT_CHECKOUT",
                        "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_ENGAGEMENT_LEAD": "TOTAL_ENGAGEMENT_LEAD",
                        "TOTAL_ENGAGEMENT_SIGNUP": "TOTAL_ENGAGEMENT_SIGNUP",
                        "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT": "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT",
                        "TOTAL_IMPRESSION_FREQUENCY": "TOTAL_IMPRESSION_FREQUENCY",
                        "TOTAL_IMPRESSION_USER": "TOTAL_IMPRESSION_USER",
                        "TOTAL_LEAD": "TOTAL_LEAD",
                        "TOTAL_OFFLINE_CHECKOUT": "TOTAL_OFFLINE_CHECKOUT",
                        "TOTAL_PAGE_VISIT": "TOTAL_PAGE_VISIT",
                        "TOTAL_REPIN_RATE": "TOTAL_REPIN_RATE",
                        "TOTAL_SIGNUP": "TOTAL_SIGNUP",
                        "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIDEO_3SEC_VIEWS": "TOTAL_VIDEO_3SEC_VIEWS",
                        "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND": "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND",
                        "TOTAL_VIDEO_MRC_VIEWS": "TOTAL_VIDEO_MRC_VIEWS",
                        "TOTAL_VIDEO_P0_COMBINED": "TOTAL_VIDEO_P0_COMBINED",
                        "TOTAL_VIDEO_P100_COMPLETE": "TOTAL_VIDEO_P100_COMPLETE",
                        "TOTAL_VIDEO_P25_COMBINED": "TOTAL_VIDEO_P25_COMBINED",
                        "TOTAL_VIDEO_P50_COMBINED": "TOTAL_VIDEO_P50_COMBINED",
                        "TOTAL_VIDEO_P75_COMBINED": "TOTAL_VIDEO_P75_COMBINED",
                        "TOTAL_VIDEO_P95_COMBINED": "TOTAL_VIDEO_P95_COMBINED",
                        "TOTAL_VIEW_ADD_TO_CART": "TOTAL_VIEW_ADD_TO_CART",
                        "TOTAL_VIEW_CHECKOUT": "TOTAL_VIEW_CHECKOUT",
                        "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIEW_LEAD": "TOTAL_VIEW_LEAD",
                        "TOTAL_VIEW_SIGNUP": "TOTAL_VIEW_SIGNUP",
                        "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CHECKOUT": "TOTAL_WEB_CHECKOUT",
                        "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CLICK_CHECKOUT": "TOTAL_WEB_CLICK_CHECKOUT",
                        "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT": "TOTAL_WEB_ENGAGEMENT_CHECKOUT",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_SESSIONS": "TOTAL_WEB_SESSIONS",
                        "TOTAL_WEB_VIEW_CHECKOUT": "TOTAL_WEB_VIEW_CHECKOUT",
                        "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "VIDEO_3SEC_VIEWS_2": "VIDEO_3SEC_VIEWS_2",
                        "VIDEO_LENGTH": "VIDEO_LENGTH",
                        "VIDEO_MRC_VIEWS_2": "VIDEO_MRC_VIEWS_2",
                        "VIDEO_P0_COMBINED_2": "VIDEO_P0_COMBINED_2",
                        "VIDEO_P100_COMPLETE_2": "VIDEO_P100_COMPLETE_2",
                        "VIDEO_P25_COMBINED_2": "VIDEO_P25_COMBINED_2",
                        "VIDEO_P50_COMBINED_2": "VIDEO_P50_COMBINED_2",
                        "VIDEO_P75_COMBINED_2": "VIDEO_P75_COMBINED_2",
                        "VIDEO_P95_COMBINED_2": "VIDEO_P95_COMBINED_2",
                        "WEB_CHECKOUT_COST_PER_ACTION": "WEB_CHECKOUT_COST_PER_ACTION",
                        "WEB_CHECKOUT_ROAS": "WEB_CHECKOUT_ROAS",
                        "WEB_SESSIONS_1": "WEB_SESSIONS_1",
                        "WEB_SESSIONS_2": "WEB_SESSIONS_2"
                    },
                    ('click_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('engagement_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('view_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('conversion_report_time',): {

                        "AD_ACTION": "TIME_OF_AD_ACTION",
                        "CONVERSION": "TIME_OF_CONVERSION"
                    },
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'start_date':
                        (date,),
                    'end_date':
                        (date,),
                    'targeting_types':
                        ([AdsAnalyticsTargetingType],),
                    'columns':
                        ([str],),
                    'granularity':
                        (Granularity,),
                    'click_window_days':
                        (int,),
                    'engagement_window_days':
                        (int,),
                    'view_window_days':
                        (int,),
                    'conversion_report_time':
                        (str,),
                    'attribution_types':
                        (ConversionReportAttributionType,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'start_date': 'start_date',
                    'end_date': 'end_date',
                    'targeting_types': 'targeting_types',
                    'columns': 'columns',
                    'granularity': 'granularity',
                    'click_window_days': 'click_window_days',
                    'engagement_window_days': 'engagement_window_days',
                    'view_window_days': 'view_window_days',
                    'conversion_report_time': 'conversion_report_time',
                    'attribution_types': 'attribution_types',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'start_date': 'query',
                    'end_date': 'query',
                    'targeting_types': 'query',
                    'columns': 'query',
                    'granularity': 'query',
                    'click_window_days': 'query',
                    'engagement_window_days': 'query',
                    'view_window_days': 'query',
                    'conversion_report_time': 'query',
                    'attribution_types': 'query',
                },
                'collection_format_map': {
                    'targeting_types': 'csv',
                    'columns': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ad_accounts_create_endpoint = _Endpoint(
            settings={
                'response_type': (AdAccount,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts',
                'operation_id': 'ad_accounts_create',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_create_request',
                ],
                'required': [
                    'ad_account_create_request',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_create_request':
                        (AdAccountCreateRequest,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'ad_account_create_request': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.ad_accounts_get_endpoint = _Endpoint(
            settings={
                'response_type': (AdAccount,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}',
                'operation_id': 'ad_accounts_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                ],
                'required': [
                    'ad_account_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ad_accounts_list_endpoint = _Endpoint(
            settings={
                'response_type': (bool, date, datetime, dict, float, int, list, str, none_type,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts',
                'operation_id': 'ad_accounts_list',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'bookmark',
                    'page_size',
                    'include_shared_accounts',
                ],
                'required': [],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'page_size',
                ]
            },
            root_map={
                'validations': {
                    ('page_size',): {

                        'inclusive_maximum': 250,
                        'inclusive_minimum': 1,
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'bookmark':
                        (str,),
                    'page_size':
                        (int,),
                    'include_shared_accounts':
                        (bool,),
                },
                'attribute_map': {
                    'bookmark': 'bookmark',
                    'page_size': 'page_size',
                    'include_shared_accounts': 'include_shared_accounts',
                },
                'location_map': {
                    'bookmark': 'query',
                    'page_size': 'query',
                    'include_shared_accounts': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.analytics_create_report_endpoint = _Endpoint(
            settings={
                'response_type': (AdsAnalyticsCreateAsyncResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/reports',
                'operation_id': 'analytics_create_report',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ads_analytics_create_async_request',
                ],
                'required': [
                    'ad_account_id',
                    'ads_analytics_create_async_request',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ads_analytics_create_async_request':
                        (AdsAnalyticsCreateAsyncRequest,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ads_analytics_create_async_request': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.analytics_get_report_endpoint = _Endpoint(
            settings={
                'response_type': (AdsAnalyticsGetAsyncResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/reports',
                'operation_id': 'analytics_get_report',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'token',
                ],
                'required': [
                    'ad_account_id',
                    'token',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'token':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'token': 'token',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'token': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )

    def ad_account_analytics(
        self,
        ad_account_id,
        start_date,
        end_date,
        columns,
        granularity,
        **kwargs
    ):
        """Get ad account analytics  # noqa: E501

        Get analytics for the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_account_analytics(ad_account_id, start_date, end_date, columns, granularity, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            start_date (date): Metric report start date (UTC). Format: YYYY-MM-DD
            end_date (date): Metric report end date (UTC). Format: YYYY-MM-DD
            columns ([str]): Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
            granularity (Granularity): TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly

        Keyword Args:
            click_window_days (int): Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            engagement_window_days (int): Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            view_window_days (int): Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.. [optional] if omitted the server will use the default value of 1
            conversion_report_time (str): The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.. [optional] if omitted the server will use the default value of "TIME_OF_AD_ACTION"
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdAccountAnalyticsResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['start_date'] = \
            start_date
        kwargs['end_date'] = \
            end_date
        kwargs['columns'] = \
            columns
        kwargs['granularity'] = \
            granularity
        return self.ad_account_analytics_endpoint.call_with_http_info(**kwargs)

    def ad_account_targeting_analytics_get(
        self,
        ad_account_id,
        start_date,
        end_date,
        targeting_types,
        columns,
        granularity,
        **kwargs
    ):
        """Get targeting analytics for an ad account  # noqa: E501

        <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/features/ads-management/'>Learn more</a>.</strong> <p/>n Get targeting analytics for an ad account. For the requested account and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. \"age_bucket\") for applicable values (e.g. \"45-49\"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_account_targeting_analytics_get(ad_account_id, start_date, end_date, targeting_types, columns, granularity, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            start_date (date): Metric report start date (UTC). Format: YYYY-MM-DD
            end_date (date): Metric report end date (UTC). Format: YYYY-MM-DD
            targeting_types ([AdsAnalyticsTargetingType]): Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
            columns ([str]): Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
            granularity (Granularity): TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly

        Keyword Args:
            click_window_days (int): Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            engagement_window_days (int): Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            view_window_days (int): Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.. [optional] if omitted the server will use the default value of 1
            conversion_report_time (str): The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.. [optional] if omitted the server will use the default value of "TIME_OF_AD_ACTION"
            attribution_types (ConversionReportAttributionType): List of types of attribution for the conversion report. [optional]
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            MetricsResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['start_date'] = \
            start_date
        kwargs['end_date'] = \
            end_date
        kwargs['targeting_types'] = \
            targeting_types
        kwargs['columns'] = \
            columns
        kwargs['granularity'] = \
            granularity
        return self.ad_account_targeting_analytics_get_endpoint.call_with_http_info(**kwargs)

    def ad_accounts_create(
        self,
        ad_account_create_request,
        **kwargs
    ):
        """Create ad account  # noqa: E501

        Create a new ad account. Different ad accounts can support different currencies, payment methods, etc. An ad account is needed to create campaigns, ad groups, and ads; other accounts (your employees or partners) can be assigned business access and appropriate roles to access an ad account. <p/> You can set up up to 50 ad accounts per user. (The user must have a business account to create an ad account.) <p/> For more, see <a class=\"reference external\" href=\"https://help.pinterest.com/en/business/article/create-an-advertiser-account\">Create an advertiser account</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_accounts_create(ad_account_create_request, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_create_request (AdAccountCreateRequest): Ad account to create.

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdAccount
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_create_request'] = \
            ad_account_create_request
        return self.ad_accounts_create_endpoint.call_with_http_info(**kwargs)

    def ad_accounts_get(
        self,
        ad_account_id,
        **kwargs
    ):
        """Get ad account  # noqa: E501

        Get an ad account  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_accounts_get(ad_account_id, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdAccount
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        return self.ad_accounts_get_endpoint.call_with_http_info(**kwargs)

    def ad_accounts_list(
        self,
        **kwargs
    ):
        """List ad accounts  # noqa: E501

        Get a list of the ad_accounts that the \"operation user_account\" has access to. - This includes ad_accounts they own and ad_accounts that are owned by others who have granted them <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_accounts_list(async_req=True)
        >>> result = thread.get()


        Keyword Args:
            bookmark (str): Cursor used to fetch the next page of items. [optional]
            page_size (int): Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.. [optional] if omitted the server will use the default value of 25
            include_shared_accounts (bool): Include shared ad accounts. [optional] if omitted the server will use the default value of True
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            bool, date, datetime, dict, float, int, list, str, none_type
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        return self.ad_accounts_list_endpoint.call_with_http_info(**kwargs)

    def analytics_create_report(
        self,
        ad_account_id,
        ads_analytics_create_async_request,
        **kwargs
    ):
        """Create async request for an account analytics report  # noqa: E501

        This returns a token that you can use to download the report when it is ready. Note that this endpoint requires the parameters to be passed as JSON-formatted in the request body. This endpoint does not support URL query parameters. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.analytics_create_report(ad_account_id, ads_analytics_create_async_request, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ads_analytics_create_async_request (AdsAnalyticsCreateAsyncRequest):

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdsAnalyticsCreateAsyncResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ads_analytics_create_async_request'] = \
            ads_analytics_create_async_request
        return self.analytics_create_report_endpoint.call_with_http_info(**kwargs)

    def analytics_get_report(
        self,
        ad_account_id,
        token,
        **kwargs
    ):
        """Get the account analytics report created by the async call  # noqa: E501

        This returns a URL to an analytics report given a token returned from the post request report creation call. You can use the URL to download the report and it's valid for an hour. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.analytics_get_report(ad_account_id, token, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            token (str): Token returned from the post request creation call

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdsAnalyticsGetAsyncResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['token'] = \
            token
        return self.analytics_get_report_endpoint.call_with_http_info(**kwargs)

